
package com.fis.mca.persistence;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import com.fis.mca.util.StringUtil;


/**
 * <p>Java class for mcaAction complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="mcaAction">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="actionId" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *         &lt;element name="cdrDetails" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="code" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="functionName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="mcaActionAudits" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaActionParams" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaAdvertisements" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaInteractions" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaMailLogs" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaService" type="{http://action.mca.fis.com/}mcaService" minOccurs="0"/>
 *         &lt;element name="mcaSmsCommands" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSmsLogs" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSmsSchedules" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="mcaSubPromDetails" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="promotionDetails" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *         &lt;element name="provisioned" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="targetUrlCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="tariffPlans" type="{http://www.w3.org/2001/XMLSchema}anyType" maxOccurs="unbounded" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "mcaAction", propOrder = {
    "actionId",
    "cdrDetails",
    "code",
    "description",
    "functionName",
    "mcaActionAudits",
    "mcaActionParams",
    "mcaAdvertisements",
    "mcaInteractions",
    "mcaMailLogs",
    "mcaService",
    "mcaSmsCommands",
    "mcaSmsLogs",
    "mcaSmsSchedules",
    "mcaSubPromDetails",
    "name",
    "promotionDetails",
    "provisioned",
    "status",
    "targetUrlCode",
    "tariffPlans"
})
public class McaAction implements Comparable<McaAction>{

    protected int actionId;
    @XmlElement(nillable = true)
    protected List<Object> cdrDetails;
    protected String code;
    protected String description;
    protected String functionName;
    @XmlElement(nillable = true)
    protected List<Object> mcaActionAudits;
    @XmlElement(nillable = true)
    protected List<Object> mcaActionParams;
    @XmlElement(nillable = true)
    protected List<Object> mcaAdvertisements;
    @XmlElement(nillable = true)
    protected List<Object> mcaInteractions;
    @XmlElement(nillable = true)
    protected List<Object> mcaMailLogs;
    protected McaService mcaService;
    @XmlElement(nillable = true)
    protected List<Object> mcaSmsCommands;
    @XmlElement(nillable = true)
    protected List<Object> mcaSmsLogs;
    @XmlElement(nillable = true)
    protected List<Object> mcaSmsSchedules;
    @XmlElement(nillable = true)
    protected List<Object> mcaSubPromDetails;
    protected String name;
    @XmlElement(nillable = true)
    protected List<Object> promotionDetails;
    protected String provisioned;
    protected String status;
    protected String targetUrlCode;
    @XmlElement(nillable = true)
    protected List<Object> tariffPlans;

    /**
     * Gets the value of the actionId property.
     * 
     */
    public int getActionId() {
        return actionId;
    }

    /**
     * Sets the value of the actionId property.
     * 
     */
    public void setActionId(int value) {
        this.actionId = value;
    }

    /**
     * Gets the value of the cdrDetails property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the cdrDetails property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getCdrDetails().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getCdrDetails() {
        if (cdrDetails == null) {
            cdrDetails = new ArrayList<Object>();
        }
        return this.cdrDetails;
    }

    /**
     * Gets the value of the code property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the value of the code property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setCode(String value) {
    	this.code = value.trim().toUpperCase();
    }

    /**
     * Gets the value of the description property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setDescription(String value) {
        this.description = value;
    }

    /**
     * Gets the value of the functionName property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getFunctionName() {
        return functionName;
    }

    /**
     * Sets the value of the functionName property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setFunctionName(String value) {
        this.functionName = value;
    }

    /**
     * Gets the value of the mcaActionAudits property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaActionAudits property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaActionAudits().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaActionAudits() {
        if (mcaActionAudits == null) {
            mcaActionAudits = new ArrayList<Object>();
        }
        return this.mcaActionAudits;
    }

    /**
     * Gets the value of the mcaActionParams property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaActionParams property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaActionParams().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaActionParams() {
        if (mcaActionParams == null) {
            mcaActionParams = new ArrayList<Object>();
        }
        return this.mcaActionParams;
    }

    /**
     * Gets the value of the mcaAdvertisements property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaAdvertisements property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaAdvertisements().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaAdvertisements() {
        if (mcaAdvertisements == null) {
            mcaAdvertisements = new ArrayList<Object>();
        }
        return this.mcaAdvertisements;
    }

    /**
     * Gets the value of the mcaInteractions property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaInteractions property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaInteractions().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaInteractions() {
        if (mcaInteractions == null) {
            mcaInteractions = new ArrayList<Object>();
        }
        return this.mcaInteractions;
    }

    /**
     * Gets the value of the mcaMailLogs property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaMailLogs property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaMailLogs().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaMailLogs() {
        if (mcaMailLogs == null) {
            mcaMailLogs = new ArrayList<Object>();
        }
        return this.mcaMailLogs;
    }

    /**
     * Gets the value of the mcaService property.
     * 
     * @return
     *     possible object is
     *     {@link McaService }
     *     
     */
    public McaService getMcaService() {
        return mcaService;
    }

    /**
     * Sets the value of the mcaService property.
     * 
     * @param value
     *     allowed object is
     *     {@link McaService }
     *     
     */
    public void setMcaService(McaService value) {
        this.mcaService = value;
    }

    /**
     * Gets the value of the mcaSmsCommands property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSmsCommands property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSmsCommands().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSmsCommands() {
        if (mcaSmsCommands == null) {
            mcaSmsCommands = new ArrayList<Object>();
        }
        return this.mcaSmsCommands;
    }

    /**
     * Gets the value of the mcaSmsLogs property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSmsLogs property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSmsLogs().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSmsLogs() {
        if (mcaSmsLogs == null) {
            mcaSmsLogs = new ArrayList<Object>();
        }
        return this.mcaSmsLogs;
    }

    /**
     * Gets the value of the mcaSmsSchedules property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSmsSchedules property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSmsSchedules().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSmsSchedules() {
        if (mcaSmsSchedules == null) {
            mcaSmsSchedules = new ArrayList<Object>();
        }
        return this.mcaSmsSchedules;
    }

    /**
     * Gets the value of the mcaSubPromDetails property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the mcaSubPromDetails property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMcaSubPromDetails().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getMcaSubPromDetails() {
        if (mcaSubPromDetails == null) {
            mcaSubPromDetails = new ArrayList<Object>();
        }
        return this.mcaSubPromDetails;
    }

    /**
     * Gets the value of the name property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getName() {
        return name;
    }

    /**
     * Sets the value of the name property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setName(String value) {
    	 this.name = value.trim();
    }

    /**
     * Gets the value of the promotionDetails property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the promotionDetails property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getPromotionDetails().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getPromotionDetails() {
        if (promotionDetails == null) {
            promotionDetails = new ArrayList<Object>();
        }
        return this.promotionDetails;
    }

    /**
     * Gets the value of the provisioned property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getProvisioned() {
        return provisioned;
    }

    /**
     * Sets the value of the provisioned property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setProvisioned(String value) {
    	if ("1".equals(value) || "true".equalsIgnoreCase(value))
        {
        	this.provisioned = "1";
        }
        else
        {
        	this.provisioned = "0";
        }
    }

    /**
     * Gets the value of the status property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getStatus() {
        return status;
    }

    /**
     * Sets the value of the status property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setStatus(String value) {
    	this.status = value.trim();
    }

    /**
     * Gets the value of the targetUrlCode property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getTargetUrlCode() {
        return targetUrlCode;
    }

    /**
     * Sets the value of the targetUrlCode property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setTargetUrlCode(String value) {
        this.targetUrlCode = value;
    }

    /**
     * Gets the value of the tariffPlans property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the tariffPlans property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getTariffPlans().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * 
     * 
     */
    public List<Object> getTariffPlans() {
        if (tariffPlans == null) {
            tariffPlans = new ArrayList<Object>();
        }
        return this.tariffPlans;
    }
    @Override
    public String toString()
    {
    	return this.name;
    }
    
    public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if ((obj == null) || (obj.getClass() != this.getClass()))
		{
			return false;
		}
		// object must be Test at this point
		McaAction action = (McaAction) obj;
		return actionId == action.getActionId();
	}

	@Override
	public int compareTo(McaAction action)
	{
		String o1 = this.getName();
		String o2 = action.getName();
		return StringUtil.compareVietnameseString(o1, o2);
	}

}
